# Maintainer: Jelle van der Waa <jelle@vdwaa.nl>

pkgname=tarsnap
pkgver=1.0.40
pkgrel=2
pkgdesc='An online encrypted snapshotted backup service'
arch=('loong64' 'x86_64')
url='https://www.tarsnap.com/'
license=('custom')
depends=('bzip2' 'openssl' 'xz')
makedepends=('e2fsprogs')
source=("https://www.tarsnap.com/download/${pkgname}-autoconf-${pkgver}.tgz"
        "${pkgname}-autoconf-${pkgver}.tgz::https://www.tarsnap.com/download/tarsnap-sigs-1.0.38.asc")
validpgpkeys=('38DAFD2CEEB3E78D8627F5486D0D5B8046B64BEB')
md5sums=('e59792f4449fb7f8dfbd6814c08e3205'
         'e59792f4449fb7f8dfbd6814c08e3205')
sha256sums=('bccae5380c1c1d6be25dccfb7c2eaa8364ba3401aafaee61e3c5574203c27fd5'
            'bccae5380c1c1d6be25dccfb7c2eaa8364ba3401aafaee61e3c5574203c27fd5')

build() {
  cd "$srcdir/$pkgname-autoconf-$pkgver"
  ./configure --prefix=/usr --sysconfdir="/etc/$pkgname"
  make
}

package() {
  cd "$srcdir/$pkgname-autoconf-$pkgver"

  make DESTDIR="$pkgdir" install
  install -D -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
